<?php

class ConnectBD {

	private $con = null;
	private $consulta = null;
	
	public function __construct(){
		
		$con = mysql_connect("localhost","root","");
		mysql_select_db("9susibd",$con);
		
	}
	
	public function __destruct() {
       mysql_close($con);
   	}
   	
   	public function getQueryAllOfTable($tabela){
   		
   		$consultaLocal = mysql_query("SELECT * FROM ".$tabela."");
   		$this->consulta = $consultaLocal;
   		return $this->consulta;
   		
   	}
   	
	public function getQueryWithParamns($tabela,$campos,$where){
   		
   		$consultaLocal = mysql_query("SELECT ".$campos." FROM ".$tabela." WHERE ".$where."");
   		$this->consulta = $consultaLocal;
   		return $this->consulta;
   		
   	}
	
}




?>